{% extends 'base.html' %}
{% block titel %}发布管理系统-发布项目配置页{% endblock %}
{% block link %}
    <link rel="stylesheet" href="/static/css/compiled/user-profile.css" type="text/css" media="screen" />
    <link rel="stylesheet" type="text/css" href="/static/css/fabupeizhiye.css" />
    <link rel="stylesheet" href="/static/css/compiled/new-user.css" type="text/css" media="screen" />
{% endblock %}

{% block body %}
    <!-- main container -->
    <div class="content">
        {% if zhuangtai %}
            <div id="zhuangtai2" class="alert alert-success alert-dismissible" role="alert">
        {% else %}
            <div style="display: none"  id="zhuangtai2" class="alert alert-success alert-dismissible" role="alert">
        {% endif %}
            <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only"></span></button>
            <strong>保存成功!</strong>
        </div>
        <div class="container-fluid">
            <div id="pad-wrapper" class="new-user">
                <div class="row-fluid header">
                    <h3>发布项目配置</h3>
                    <h5 id="xinghao">* 必填</h5>
                </div>

                <div class="row-fluid form-wrapper">
                    <!-- left column -->
                    <div class="span9 with-sidebar">
                        <div class="container">
                            <form class="new_user_form inline-input" action="/publishmodify/" method="post"/>
                            {% csrf_token %}
                                <div class="span12 field-box">
                                    <label id="onegroup1">*第一组编排:</label>
                                    <input class="span9" name="onegroup" id="onegroup" value="{{ modify.onegroup }}" type="text" placeholder="第一组发布编排，请以,分隔"/>
                                </div>
                                <div class="span12 field-box">
                                    <label id="twogroup2">*第二组编排:</label>
                                    <input class="span9" name="twogroup" id="twogroup" value="{{ modify.twogroup }}"  type="text" placeholder="第二组发布编排，请以,分隔"/>
                                </div>
                                <div class="span12 field-box textarea">
                                    <label>备注:</label>
                                    <textarea class="span9" name="Remark" placeholder="备注及说明">{{ modify.Remark }}</textarea>
                                    <!--<span class="charactersleft">小于256字</span>-->
                                </div>
                                <div class="span11 field-box actions">
                                    <input type="submit" class="btn-glow primary" value="确认修改" onclick="return checkNull()" />
                                    <span>OR</span>
                                    <input type="reset" value="重置" class="reset" />
                                </div>
                           </form>
                        </div>
                    </div>

                    <!-- side right column -->
                    <div class="span3 form-sidebar pull-right">
{#                        <button class="btn" type="button" href="#myModal12">点击查看所有job</button>#}

                        <a href="#job" class="btn" role="button" rel="tooltip"  data-toggle="modal" data-placement="bottom" ><span class="icon-map-marker"> </span>点击查看所有job</a>
                        <div id="job" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h3 id="myModalLabel">jenkins中所有job</h3>
                      </div>
                      <div id="views_jenkins" class="modal-body">
                          {% for i in views_list %}
                          <p>{{ i }}</p>
                          {% endfor %}
                      </div>
                      <div class="modal-footer">
                        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
                      </div>
                    </div>
                        <div class="alert alert-info hidden-tablet">
                            <i class="icon-lightbulb pull-left"></i>
                            	请谨慎填写相关配置，用户名及密码。
                        </div>
                        <!--<h6>Sidebar text for instructions</h6>
                        <p>Add multiple users at once</p>
                        <p>Choose one of the following file types:</p>-->
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- end main container -->
{% endblock %}

{% block javascript %}
    <script type="text/javascript">
        $(document).ready(function(){
            var $canshu=$('#fbmodify');
            var $span=$('<div class="pointer"> <div class="arrow"></div> <div class="arrow_border"></div> </div>');
            $($canshu).append($span);
            $($canshu).addClass("active");
            $('#publishmodify').addClass("active");
            $('#fbmodifyul').addClass("active");
    })
    </script>
    <script type="text/javascript">
        function checkNull()
        {
            var username=$("#onegroup").val();
            var password=$("#twogroup").val();

            if(username==""){
            //显示错误提示信息
            $("#onegroup").attr('placeholder','不得为空')
            $("#onegroup1").css('color','red')
            return false;
        }else{
                $("#onegroup1").css('color','')
            }
        if(password=="") {
            $("#twogroup").attr('placeholder', '不得为空')
            $("#twogroup2").css('color', 'red')
            return false;
        }else{
            $("#twogroup2").css('color','')
        }
        return true;
             };
    </script>
{% endblock %}